namespace AccessingEmbeddedResource.Services;

public class BackgroundService : IBackgroundService {
    public async Task<byte[]> GetBackgroundImage() {
        await using var resourceStream =
            GetType().Assembly.GetManifestResourceStream("bg.jpg");
        await using var memoryStream = new MemoryStream();
        await resourceStream.CopyToAsync(memoryStream);
        return memoryStream.ToArray();
    }
}